package org.thread.test05.tx.demo05.t02;

import java.util.Random;

/**
 * 水果 - 给女孩提供各种类型的水果
 *
 * @author ZQX
 * @date 2025-03-14
 */
public class Fruit {
    /**
     * 希望给女孩的水果品类 - 随机给出
     */
    private String[] fruitArray = {"苹果", "雪梨", "香蕉", "菠萝", "橙子", "草莓"};
    /**
     * 存储数组随机的下标索引
     */
    private int index;
    public Fruit() {
        this.index = new Random().nextInt(fruitArray.length) ;
    }
    @Override
    public String toString() {
        return fruitArray[index];
    }

}
